<html xmlns="http://www.w3c.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pe="http://primefaces.org/ui/extensions">
<h:head>
	<script type="text/javascript">
		//<![CDATA[
		//debe usarse los \\:  en lugar de : en los selectores de JQuery
		$(document).ready(function() {
			wizardSetCurrentPageStyle('form_wizard:farmDataB');

		});
		//]]>
	</script>
</h:head>
<h:body>
	<h:form id="form_farm_dataB">
		<h2>
			<h:outputLabel value="#{i18n['lbl.owner.farm_general_data.title']} 2" />
		</h2>
		<div class="clearfix common-panel">
			<div class="ui-form-row-3col clearfix">
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel value="Disponibilidad de servicios" />
						<h:panelGrid columns="2" style="margin-bottom:10px"
							cellpadding="5">

							<h:outputText value="Agua Propia" />
							<p:selectBooleanCheckbox
								value="#{aSession.selectedRuatRegister.farmOwnWaterBoolean}" />

							<h:outputText value="Acueducto" />
							<p:selectBooleanCheckbox
								value="#{aSession.selectedRuatRegister.farmAqueductBoolean}" />

							<h:outputText value="Acceso a Internet" />
							<p:selectBooleanCheckbox
								value="#{aSession.selectedRuatRegister.farmInternetAccessBoolean}" />

							<h:outputText value="Energía Eléctrica" />
							<p:selectBooleanCheckbox
								value="#{aSession.selectedRuatRegister.farmElectricPowerBoolean}" />

						</h:panelGrid>
					</div>
				</div>
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel value="Manejo programa de residuos" />

						<div class="clearfix text-align-left">
							<p:selectOneRadio
								value="#{aSession.selectedRuatRegister.wasteManagementProgram}"
								id="radiowasteManagementProgram"
								onchange="disabledFuctionWaste();">
								<f:selectItem itemLabel="Si" itemValue="1" />
								<f:selectItem itemLabel="No" itemValue="2" />
							</p:selectOneRadio>
						</div>

					</div>
				</div>
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel value="Programa" />
					</div>
					<div class="clearfix text-align-left">
						<p:blockUI block="wasteManagementProgramClassId"
							widgetVar="buiWaste" />
						<p:selectOneMenu
							value="#{aSession.selectedRuatRegister.wasteManagementProgramClass}"
							id="wasteManagementProgramClassId">
							<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
								itemValue="" />
							<f:selectItems
								value="#{wasteManagementProgramClassCmb.parameterDTO.options}" />
							<f:selectItem itemLabel="#{i18n['cmpnt.other']}"
									itemValue="3"  />								
						</p:selectOneMenu>
					</div>
				</div>
			</div>
			<div class="ui-form-row-3col clearfix">
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel value="Disponibilidad de vias de acceso" />

						<div class="clearfix text-align-left">
							<p:selectOneRadio
								value="#{aSession.selectedRuatRegister.availabilityOfAccesRoads}"
								id="radioavailabilityOfAccesRoads" onchange="disabledFuctionRoads();">
								<f:selectItem itemLabel="Si" itemValue="1" />
								<f:selectItem itemLabel="No" itemValue="2" />
							</p:selectOneRadio>
						</div>

					</div>
				</div>
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel value="Paviementada" />
					</div>
					<div class="clearfix text-align-left">
						<p:blockUI block="pavedId" widgetVar="buiPaved" />
						<p:selectOneMenu value="#{aSession.selectedRuatRegister.paved}"
							id="pavedId">
							<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
								itemValue="" />
							<f:selectItems value="#{pavedCmb.parameterDTO.options}" />
						</p:selectOneMenu>
					</div>
				</div>
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel value="No paviementada" />
					</div>
					<div class="clearfix text-align-left">
						<p:blockUI block="noPavedId" widgetVar="buiNoPaved" />
						<p:selectOneMenu value="#{aSession.selectedRuatRegister.noPaved}" id="noPavedId">
							<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
								itemValue="" />
							<f:selectItems value="#{noPavedCmb.parameterDTO.options}" />
						</p:selectOneMenu>
					</div>
				</div>
			</div>
			<div class="ui-form-row-3col clearfix">
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel
							value="Distancia de la finca a la cabecera municipal (km)" />
					</div>
					<div class="clearfix text-align-left">
						<p:inputText
							value="#{aSession.selectedRuatRegister.distanceMunicipalityTown}" required="true" id="distanceMun"/>
						<pe:keyFilter for="distanceMun" mask="pnum"/>	
					</div>
				</div>
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel
							value="Medio de trasporte para la realizacion de actividad productiva y de comercialización" />
					</div>
					<div class="clearfix text-align-left">
						<p:selectOneMenu
							value="#{aSession.selectedRuatRegister.meansOfTransportation}" required="true">
							<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
								itemValue="" noSelectionOption="true"/>
							<f:selectItems
								value="#{meansOfTransportationCmb.parameterDTO.options}" />
						</p:selectOneMenu>
					</div>
				</div>
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel
							value="Maquinaria y equipos para la realización de actividades productivas y de comercialización" />
					</div>
					<div class="clearfix text-align-left">
						<p:selectOneMenu
							value="#{aSession.selectedRuatRegister.machineryAndEquipment}" required="true">
							<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
								itemValue="" noSelectionOption="true"/>
							<f:selectItems
								value="#{machineryAndEquipmentCmb.parameterDTO.options}" />
						</p:selectOneMenu>
					</div>
				</div>
			</div>
		</div>
		<div class="buttons-container clearfix text-align-right">
			<p:commandButton value="#{i18n['lbl.flow_button.cancel']}"
				styleClass="ui-flowbutton"
				oncomplete="currentPage('list_owner_data.xhtml')"
				actionListener="#{stepByStepController.cancelRuatRegister}" />
			<p:commandButton value="#{i18n['lbl.flow_button.back']}"
				oncomplete="setCurrentPageStyle(xhr, status, args,this)"
				styleClass="ui-flowbutton" update="form_farm_dataB"
				actionListener="#{stepByStepController.viewAssociativityData}" />
			<p:commandButton value="#{i18n['lbl.flow_button.save_and_next']}"
				oncomplete="setCurrentPageStyle(xhr, status, args,this)"
				styleClass="ui-flowbutton" validateClient="true"
				update="form_farm_dataB"
				actionListener="#{stepByStepController.viewAgrarianBusinessData}"  
				id="savenext" />
		</div>
		<p:blockUI block="savenext" trigger="savenext"/>
	</h:form>
</h:body>
<script type="text/javascript">
	//<![CDATA[
	//debe usarse los \\:  en lugar de : en los selectores de JQuery
	$(document).ready(function() {
		disabledFuctionWaste();
		disabledFuctionRoads();
	});
	function disabledFuctionWaste() {
		var valor = $(
				'input[name=form_farm_dataB\\:radiowasteManagementProgram]:checked')
				.val();
		if (valor == 1) {
			PF('buiWaste').hide();
		} else {
			PF('buiWaste').show();
		}

	}
	function disabledFuctionRoads() {
		var valor = $(
				'input[name=form_farm_dataB\\:radioavailabilityOfAccesRoads]:checked')
				.val();
		if (valor == 1) {
			PF('buiPaved').hide();
			PF('buiNoPaved').hide();
		} else {
			PF('buiPaved').show();
			PF('buiNoPaved').show();
		}
	}
	//]]>
</script>
</html>